home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Cell Control / DATA1.CAB / DELPHIDM / UChart.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-01-11  |  2.9 KB  |  95 lines

  1. unit UChart;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Tempunit, ComCtrls, StdCtrls, Buttons, OleCtrls, CELLLib_TLB, ExtCtrls;
  8.  
  9. type
  10.   TFChart = class(TTemplate)
  11.     procedure FormShow(Sender: TObject);
  12.   private
  13.     { Private declarations }
  14.   public
  15.     { Public declarations }
  16.   end;
  17.  
  18. var
  19.   FChart: TFChart;
  20.  
  21. implementation
  22.  
  23. {$R *.DFM}
  24.  
  25. procedure TFChart.FormShow(Sender: TObject);
  26. begin
  27.   inherited;
  28.   Cell1.DoSetCellString( 0, 0, 'Rate');
  29.   Cell1.DoSetCellString( 1, 0, '3 months');
  30.   Cell1.DoSetCellString( 2, 0, '6 months');
  31.   Cell1.DoSetCellString( 3, 0, '1 year');
  32.   Cell1.DoSetCellString( 4, 0, '2 years');
  33.   Cell1.DoSetCellString( 5, 0, '3 years');
  34.   Cell1.DoSetCellString( 6, 0, '5 years');
  35.  
  36.   Cell1.DoSetCellString( 0, 1, 'Rate of mouth');
  37.   Cell1.DoSetCellValue( 1, 1, 2.4);
  38.   Cell1.DoSetCellValue( 2, 1, 3.45);
  39.   Cell1.DoSetCellValue( 3, 1, 4.725);
  40.   Cell1.DoSetCellValue( 4, 1, 4.95);
  41.   Cell1.DoSetCellValue( 5, 1, 5.175);
  42.   Cell1.DoSetCellValue( 6, 1, 5.55);
  43.  
  44.   Cell1.DoSetCellString( 0, 2, 'Rate of year');
  45.   Cell1.DoSetCellValue(1, 2, 2.88);
  46.   Cell1.DoSetCellValue(2, 2, 4.14);
  47.   Cell1.DoSetCellValue(3, 2, 5.67);
  48.   Cell1.DoSetCellValue(4, 2, 5.94);
  49.   Cell1.DoSetCellValue(5, 2, 6.21);
  50.   Cell1.DoSetCellValue(6, 2, 6.66);
  51.  
  52.  
  53.   Cell1.DoJoinCells( 1, 4, 5, 8);
  54.   Cell1.DoSetRefChart( 1, 4, 0, 0, 6, 2);
  55.  
  56.   Cell1.DoJoinCells( 1, 10, 5, 14);
  57.   Cell1.DoSetChart( 1, 10, 5, 5);
  58.  
  59.   Cell1.DoSetChartStringData( 1, 10, 0, 0, 'Region');
  60.   Cell1.DoSetChartStringData( 1, 10, 1, 0, 'Peking');
  61.   Cell1.DoSetChartStringData( 1, 10, 2, 0, 'Macao');
  62.   Cell1.DoSetChartStringData( 1, 10, 3, 0, 'Taipei');
  63.   Cell1.DoSetChartStringData( 1, 10, 4, 0, 'Hongkong');
  64.  
  65.   Cell1.DoSetChartStringData( 1, 10, 0, 1, '1 quarter');
  66.   Cell1.DoSetChartStringData( 1, 10, 0, 2, '2 quarter');
  67.   Cell1.DoSetChartStringData( 1, 10, 0, 3, '3 quarter');
  68.   Cell1.DoSetChartStringData( 1, 10, 0, 4, '4 quarter');
  69.  
  70.   Cell1.DoSetChartValueData( 1, 10, 1, 1, 29876);
  71.   Cell1.DoSetChartValueData( 1, 10, 1, 2, 34123);
  72.   Cell1.DoSetChartValueData( 1, 10, 1, 3, 42221);
  73.   Cell1.DoSetChartValueData( 1, 10, 1, 4, 52123);
  74.  
  75.   Cell1.DoSetChartValueData( 1, 10, 2, 1, 32365);
  76.   Cell1.DoSetChartValueData( 1, 10, 2, 2, 35432);
  77.   Cell1.DoSetChartValueData( 1, 10, 2, 3, 30283);
  78.   Cell1.DoSetChartValueData( 1, 10, 2, 4, 45322);
  79.  
  80.   Cell1.DoSetChartValueData( 1, 10, 3, 1, 32007);
  81.   Cell1.DoSetChartValueData( 1, 10, 3, 2, 23481);
  82.   Cell1.DoSetChartValueData( 1, 10, 3, 3, 40624);
  83.   Cell1.DoSetChartValueData( 1, 10, 3, 4, 34528);
  84.  
  85.   Cell1.DoSetChartValueData( 1, 10, 4, 1, 31232);
  86.   Cell1.DoSetChartValueData( 1, 10, 4, 2, 30345);
  87.   Cell1.DoSetChartValueData( 1, 10, 4, 3, 27943);
  88.   Cell1.DoSetChartValueData( 1, 10, 4, 4, 32109);
  89.  
  90.   Cell1.DoSetChartGeneralData( 1, 10, 1, False, 'Sale', 'Chart 2', 'Ten thousand');
  91.   Cell1.DoRefreshChart( 1, 10);
  92. end;
  93.  
  94. end.
  95.